

package cn.myzf.fort.access.accesscommon.core;


import cn.myzf.fort.access.accesscommon.core.impl.CustomStreamingProcess;
import cn.myzf.fort.access.accesscommon.processoutput.output.StreamingProcessOutput;

public abstract class AbstractBinaryWithTimeout
  extends AbstractBinary {

  protected int max_time;


  public void reset() {
    super.reset();
    max_time = -1;
  }

  public int getMaxTime() {
    return max_time;
  }


  public AbstractBinaryWithTimeout maxTime(int max_time) {
    if (max_time < 1)
      max_time = -1;
    this.max_time = max_time;
    return this;
  }


  public StreamingProcessOutput execute() throws Exception {
    StreamingProcessOutput	result;

    result = new StreamingProcessOutput(new CustomStreamingProcess(foward_info));
    result.setTimeOut(max_time);
    result.monitor("n",builder());
    return result;
  }
}
